#pragma once

class Tooltip
{
	friend class TooltipManager;
	std::string mTitle;
	std::string mMessage;
	ui32 mElemsHorizontal, mElemsVertical;
	void Draw(ui32 x, ui32 y);
	ui32 GetBodyHeight(bool aspect = false) { return mFontMessage->GetMultiLineHeight(mMessage, 250, aspect) * mFontMessage->GetYAspect(); }
	void CalcBorderElems();
	void DrawBorder(ui32 x, ui32 y);
	void DrawTopEdges(ui32 x, ui32 y);
	void DrawBottomEdges(ui32 x, ui32 y);
	void DrawTopBorder(ui32 x, ui32 y);
	void DrawSideBorder(ui32 x, ui32 y);
	void DrawBackground(ui32 x, ui32 y);

	static CFont* mFontTitle, *mFontMessage;
	static Texture* mBorderTexture, *mBackground;
public:
	Tooltip();
	void SetTitle(const std::string& title) { mTitle = title; }
	void SetMessage(const std::string& message) { mMessage = message; CalcBorderElems(); }
	bool IsEmpty() { return (mTitle == "" && mMessage == ""); }
};